package com.qf.service.impl;

import com.github.pagehelper.PageHelper;
import com.qf.mapper.CustomerMapper;
import com.qf.pojo.Customer;
import com.qf.service.CustomerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 作者：冯国清
 * 项目名：com.qf.service.impl
 * 时间：2020/7/27 22:02
 * 描述:
 */
@Service
public class CustomerServiceImpl implements CustomerService {
    @Resource
    private CustomerMapper customerMapper;
    @Override
    public List<Customer> getAllCustomer(int page,int limit) {
        PageHelper.startPage(page,limit);
        return customerMapper.getAllCustomer();
    }

    @Override
    public int getCount() {
        return customerMapper.getCount();
    }

    @Override
    public int saveCustomer(Customer customer) {
        return customerMapper.saveCustomer(customer);
    }

    @Override
    public Customer selectCustomerById(int cid) {
        return customerMapper.selectCustomerById(cid);
    }

    @Override
    public int updateCustomer(Customer customer) {
        return customerMapper.updateCustomer(customer);
    }

    @Override
    public int deleteCustomer(int cid) {
        return customerMapper.deleteCustomer(cid);
    }

    @Override
    public int deleteByIds(int[] cids) {
        return customerMapper.deleteByIds(cids);
    }
}
